home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 06a.Gauge / MyView.m < prev    next >
Text File  |  1995-06-12  |  720b  |  38 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "MyView.h"
  5. #import <dpsclient/wraps.h>
  6. #import <appkit/Control.h>
  7.  
  8. #define ARROW_LENGTH 20.0
  9.  
  10. @implementation MyView
  11.  
  12. - mySlider:sender
  13. {
  14.     myFloat = [sender floatValue];
  15.     [self display];
  16.     return self;
  17. }
  18.  
  19. - drawSelf:(NXRect*)r :(int)c
  20. {
  21.     NXEraseRect(&bounds);
  22.     PSsetgray(NX_BLACK);
  23.     PSsetlinewidth(10.0);
  24.     PStranslate(bounds.size.width*0.5, bounds.size.height*0.1);
  25.     PSrotate(-myFloat);
  26.     PSnewpath();
  27.         PSmoveto(0.0, 0.0);
  28.         PSlineto(0.0, bounds.size.height*0.7);
  29.         PSrmoveto(-ARROW_LENGTH, -ARROW_LENGTH);
  30.         PSrlineto(ARROW_LENGTH, ARROW_LENGTH);
  31.         PSrlineto(ARROW_LENGTH, -ARROW_LENGTH);
  32.     PSstroke();
  33.     return self;
  34. }
  35.  
  36.  
  37. @end
  38.